#pragma once
#include <unistd.h>
#include <fcntl.h>
#include "Log.hpp"
void SetNonBlock(int fd)
{
    int fl = fcntl(fd, F_GETFL);
    if(fd < 0)
    {
        lg(Error, "SetNonBlock err, errstring: %s", strerror(errno));
        return;
    }
    fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}